
public class LineItem
{
   private String name;
   private double price; 
   
   public LineItem(String n, double p) 
   { 
      name = n ; price = p;
   }
   public String getName() 
   { 
      return name;
   }
   public double getPrice() 
   { 
      return price;
   }
   public String toString()
   {
      return name+" $"+price;
   }
   public boolean equals(LineItem a)
   {
      boolean result = false;
      
      if(a.getName().compareTo(this.name)==0
         && a.getPrice()-this.price==0)
      {
         result = true;
      }
      
      return result;
   }
}
